package edu.spec.dengyan.week08.class01.book.unit3;

/**
 * Author       : Dengyan
 * Date         : 2018/10/11 23:19
 * Description  : “学生”类
 */
public class Student {
    int sNO;
    String sName;
    char sSex;
    int sAge;
    int sJava;

    public Student(int sNO,String sName,char sSex,int sAge,int sJava){

        this.sNO=sNO;
        this.sName=sName;
        this.sSex=sSex;
        this.sAge=sAge;
        this.sJava=sJava;

    }

    public int getsNO(){

        return sNO;

    }

    public String getsName(){

        return sName;

    }

    public char getsSex(){

        return sSex;

    }

    public int getsAge(){

        return sAge;

    }

    public int getsJava() {

        return sJava;
    }
        public static void main(String[] args){

            Student s1=new Student(10,"小小",'女',19,70);
            Student s2=new Student(38,"明明",'女',18,75);
            Student s3=new Student(21,"慧慧",'女',21,76);
            Student s4=new Student(19,"猪猪",'男',20,80);
            Student s5=new Student(20,"吉吉",'男',17,88);

            System.out.println("学号："+s1.getsNO()+"姓名："+s1.getsName()+"性别："
                    +s1.getsSex()+"年龄："+s1.getsAge()+"Java成绩："+s1.getsJava());
            System.out.println("学号："+s2.getsNO()+"姓名："+s2.getsName()+"性别："
                    +s2.getsSex()+"年龄："+s2.getsAge()+"Java成绩："+s2.getsJava());
            System.out.println("学号："+s3.getsNO()+"姓名："+s3.getsName()+"性别："
                    +s3.getsSex()+"年龄："+s3.getsAge()+"Java成绩："+s3.getsJava());
            System.out.println("学号："+s4.getsNO()+"姓名："+s4.getsName()+"性别："
                    +s4.getsSex()+"年龄："+s4.getsAge()+"Java成绩："+s4.getsJava());
            System.out.println("学号："+s5.getsNO()+"姓名："+s5.getsName()+"性别："
                    +s5.getsSex()+"年龄："+s5.getsAge()+"Java成绩："+s5.getsJava());

            int sum=s1.getsJava()+s2.getsJava()+s3.getsJava()+s4.getsJava()+s5.getsJava();
            System.out.println("平均分："+sum/5);
            int data[]={s1.getsJava(),s2.getsJava(),s3.getsJava(),s4.getsJava(),s5.getsJava()};

            java.util.Arrays.sort(data);//数字从小到大排序

            System.out.println("最高分："+data[4]);
            System.out.println("最低分："+data[0]);
        }

}

